<script setup>
import student1 from "./school/Student1.vue";
import student2 from "./school/Student2.vue";
import {ref} from "vue";

const count = ref(5);
const arr = ref([1, 2, 3, 4, 5]);
const p = ref({
  username: "黎悠",
  age: 20,
});

const counts = ref(0);
const add = (count) => {
  counts.value += count;
}

</script>

<template>
  <div>
    <student1 :number="count" :ids="arr" :person="p"></student1>
  </div>
  <div style="margin-top: 20px;"></div>
  <div>
    <p>父组件属性counts：{{ counts }}</p>
    <student2 @receivePCount="add"></student2>
  </div>

</template>

<style scoped>

</style>